<?php

class IndexModel extends Model {
	
	// EXAMPLE DATABASE INTERACTION
	public function getUser($user_id) {
		/* 
		if(!$this->sql) throw new Exception('No database connection.', 501);
		if(!is_numeric($user_id)) throw new Exception('Entered value is not a number.', 501);
		
		$state = $this->sql->prepare("SELECT * FROM users WHERE user_id = :user_id");
		$state->bindParam(':user_id', $user_id, PDO::PARAM_INT);
		$state->execute();
		return $state->fetch(PDO::FETCH_ASSOC);	// Return just one row
		// return $state->fetchAll(PDO::FETCH_ASSOC); // Return all rows
		*/
		return array(0=>'Example User');	// Just example output fron the sql above.
	}
}
?>